<?php
	require_once("UserVO.php");
	
	/**
	 * Value object representation of a blog post.
	 */
	class BlogPostVO {
		
		var $_explicitType="vo.BlogPostVO";
		
		/** The unique ID of the blog post. */
		var $blogPostUID;
		
		/** The details of the user who made the post. */
		var $user;
		
		/** The heading of the post. */
		var $heading;
		
		/** The message body of the post. */
		var $message;
		
		/** The date the post was created. */
		var $dateCreated;
		
		/** Array of comments made on the post. */
		var $comments;
		
		/** Creates a new instance of a BlogPostVO. */
		public function BlogPostVO() {}
		
		/**
		 * Maps a database record to a BlogPostVO.
		 * @param $row The record to map to a BlogPostVO.
		 * @return A new mapped instance of a BlogPostVO.
		 */
		public static function mapObject($row) {
			
			$vo = new BlogPostVO();
			
			$vo->blogPostUID 	= $row["blogPostUID"];
			$vo->user 			= UserVO::mapObject($row);
			$vo->heading 		= $row["heading"];
			$vo->message 		= $row["message"];
			$vo->dateCreated 	= $row["dateCreated"];
			
			return $vo;
		}
	}
?>